home *** CD-ROM | disk | FTP | other *** search
/ Resource for Source: C/C++ / Resource for Source - C-C++.iso / codelib9 / v_11_08 / 1108118b < prev    next >
Encoding:
Text File  |  1995-11-01  |  290 b   |  21 lines

  1.  1: class X
  2.  2:     {
  3.  3:     int i;
  4.  4:     static int k;
  5.  5: public:
  6.  6:     enum { MAX = 100 };
  7.  7:     X();
  8.  8:     void reset() { k = MAX; }
  9.  9:     };
  10. 10: 
  11. 11: const int MIN = 0;
  12. 12: 
  13. 13: void X::X() : i(MAX)
  14. 14:     {
  15. 15:     if (--k <= MIN)
  16. 16:         reset();
  17. 17:     }
  18. 18: 
  19. 19: int X::k = MAX;
  20.  
  21.